import Vue from 'vue'
import Router from 'vue-router'

Vue.use(Router)

export default new Router({
    mode: 'hash',
    base: process.env.BASE_URL,
    routes: [{
            path: '/',
            redirect: 'login'
        },
        {
            path: '/login',
            name: 'login',
            component: () =>
                import ('./views/login.vue'),
        },
        {
            path: '/home',
            name: 'home',
            component: () =>
                import ('./views/Home.vue'),
            children: [{
                    path: '',
                    component: () =>
                        import ('./views/index.vue'),
                    meta: {
                        title: ['商户', '商户列表'],
                        keepAlive: true
                    }
                },
                {
                    path: '/shopAll',
                    name: 'shopAll',
                    component: () =>
                        import ('./views/shopAll.vue'),
                    meta: {
                        title: ['商户', '总店'],
                        keepAlive: true
                    }
                },
                {
                    path: '/notice',
                    name: 'notice',
                    component: () =>
                        import ('./views/notice.vue'),
                    meta: {
                        title: ['商户', '公告管理'],
                        keepAlive: true
                    }
                },
                {
                    path: '/shopType',
                    name: 'shopType',
                    component: () =>
                        import ('./views/shopType.vue'),
                    meta: {
                        title: ['商户', '商户分类'],
                        keepAlive: true
                    }
                },
            ]
        }
    ]
})